package org.nstack.storage.primary.local;

import org.nstack.storage.primary.local.LocalStorageKvmSftpBackupStorageMediatorImpl.SftpDownloadBitsCmd;
import org.nstack.storage.primary.local.LocalStorageKvmSftpBackupStorageMediatorImpl.SftpUploadBitsCmd;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;


public class LocalStorageSimulatorConfig {
    public static class Capacity {
        public long total;
        public long avail;
    }

    public Map<String, Capacity> capacityMap = new HashMap<>();
    public List<LocalStorageKvmBackend.InitCmd> initCmdList = new ArrayList<>();
    public List<LocalStorageKvmBackend.GetPhysicalCapacityCmd> getPhysicalCapacityCmds = new ArrayList<>();
    public List<LocalStorageKvmBackend.CreateEmptyVolumeCmd> createEmptyVolumeCmds = new ArrayList<>();
    public List<LocalStorageKvmBackend.CreateVolumeFromCacheCmd> createVolumeFromCacheCmds = new ArrayList<>();
    public List<LocalStorageKvmBackend.DeleteBitsCmd> deleteBitsCmds = new ArrayList<>();
    public List<LocalStorageKvmBackend.DeleteBitsCmd> deleteDirCmds = new ArrayList<>();
    public List<SftpUploadBitsCmd> uploadBitsCmds = new ArrayList<>();
    public List<SftpDownloadBitsCmd> downloadBitsCmds = new ArrayList<>();
    public List<LocalStorageKvmBackend.CreateTemplateFromVolumeCmd> createTemplateFromVolumeCmds = new ArrayList<>();
    public List<LocalStorageKvmBackend.RevertVolumeFromSnapshotCmd> revertVolumeFromSnapshotCmds = new ArrayList<>();
    public List<LocalStorageKvmBackend.MergeSnapshotCmd> mergeSnapshotCmds = new ArrayList<>();
    public List<LocalStorageKvmBackend.RebaseAndMergeSnapshotsCmd> rebaseAndMergeSnapshotsCmds = new ArrayList<>();
    public List<LocalStorageKvmBackend.OfflineMergeSnapshotCmd> offlineMergeSnapshotCmds = new ArrayList<>();
    public List<LocalStorageKvmBackend.CheckBitsCmd> checkBitsCmds = new ArrayList<>();
    public List<LocalStorageKvmBackend.RebaseRootVolumeToBackingFileCmd> rebaseRootVolumeToBackingFileCmds = new ArrayList<>();
    public List<LocalStorageKvmMigrateVmFlow.RebaseSnapshotBackingFilesCmd> rebaseSnapshotBackingFilesCmds = new ArrayList<>();
    public List<LocalStorageKvmMigrateVmFlow.VerifySnapshotChainCmd> verifySnapshotChainCmds = new ArrayList<>();
    public List<LocalStorageKvmMigrateVmFlow.CopyBitsFromRemoteCmd> copyBitsFromRemoteCmds = new ArrayList<>();
    public List<LocalStorageKvmBackend.GetMd5Cmd> getMd5Cmds = new ArrayList<>();
    public List<LocalStorageKvmBackend.CheckMd5sumCmd> checkMd5sumCmds = new ArrayList<>();
    public List<LocalStorageKvmBackend.GetBackingFileCmd> getBackingFileCmds = new ArrayList<>();
    public volatile String backingFilePath;
    public volatile Long backingFileSize;
    public volatile boolean checkMd5Success = true;
    public volatile boolean checkBitsSuccess = true;
    public volatile boolean copyBitsFromRemoteSuccess = true;

    public Map<String, Long> snapshotToVolumeSize = new HashMap<>();
    public Map<String, Long> snapshotToVolumeActualSize = new HashMap<>();
    public List<LocalStorageKvmBackend.GetVolumeSizeCmd> getVolumeSizeCmds = new ArrayList<>();
    public Map<String, Long> getVolumeSizeCmdActualSize = new HashMap<>();
    public Map<String, Long> getVolumeSizeCmdSize = new HashMap<>();

    public Map<String, String> getVolumeBaseImagePaths = new HashMap<>();

    public List<LocalStorageKvmBackend.GetQCOW2ReferenceCmd> getQCOW2ReferenceCmds = new ArrayList<>();
    public List<String> getQCOW2ReferenceCmdReference = new ArrayList<>();
}
